#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time    : 2022/5/2 10:02 下午
# @Author  : WangZhixing

#对代码中的一些常见符号进行计数
import os
def count(symbol,file,):
    with open(file,"r") as fp:
        content = fp.read()
        return content.count(symbol)

def project_count(path,symbol):
    dic = {}
    for root, dirs, files in os.walk(".", topdown=False):
        for name in files:
            pass

    for file in os.listdir(path):

        if not file.startswith("."):
            file_path = os.path.join(path,file)
            dic[file] = count(symbol,file_path)


if __name__ == '__main__':
    project_path = "/Users/wzx/Downloads/research/bash"
    symbol = "error"
    print(project_count(project_path,symbol))
